package loader;

import java.sql.SQLException;

import loader.persister.DealPersister;
import loader.persister.Persister;

public class TimerLoader {

	private String[] cities;

	public TimerLoader(String[] cities) {
		this.cities = cities;
	}

	public void load() {

		Loader loader = new Loader();
		Persister persister = new DealPersister();
		// persister.clear();
		loader.setPersister(persister);

		for (String city : cities)
			loader.load(city.trim());

		try {
			persister.close();
		} catch (SQLException e) {
			e.printStackTrace();
		}
	}
}
